EncodePointer / DecodePointer functions for KERNEL32.DLL in Windows XP/2003#
kernel32-obfuscated-pointers
Purpose/History#
These functions are used by Windows Applications to make memory pointers more secure.
The EncodePointer / DecodePointer code used originally comes from Wine:
https://github.com/rpodgorny/wine/blob/master/libs/port/interlocked.c
https://github.com/wine-mirror/wine/blob/master/dlls/ntdll/rtl.c
Here is a essay about these functions https://devblogs.microsoft.com/oldnewthing/20201113-00/?p=104447:
Requirements#
- A x86 version of Windows 2003 / XP SP1 with source code available: see https://rentry.co/build-win2k3
- Ability to execute executables built for newer versions than Windows XP SP2 / Windows Server 2003 RTM (NT 5.2): https://rentry.co/kernel32-version-unlock
Changes#
- change
\base\win32\client\baseinit.c: add the following block
- In
\base\win32\client\kernel32.src: add these two lines
- Run
bcz(notbzas it will not add the two functions to KERNEL32.DLL) - Overwrite the created
\base\win32\client\daytona\obj\i386\KERNEL32.DLLin theC:\WINDOWS\SYSTEM32folder of your Windows XP installation.